import request from "@/utils/http";

// 获取用户列表
export const userListAPI = (size, page, selectKey) => {
    return request.get(`api/user/list/${page}/${size}?selectKey=${selectKey}`)
}

// 用户状态改变
export const userStateUpdateAPI = (id, states) => {
    return request.put("api/user/updateState", {
        id: id,
        enabled: !states
    })
}

// 添加用户
export const addUserAPI = (user) => {
    return request.post("api/user/add", user)
}

// 根据用户查询用户信息
export const getUserByIdAPI = (id) => {
    return request.get(`api/user/${id}`)
}
// 根据用户查询用户信息
export const updateAPI = (data) => {
    return request.put("api/user/update", data)
}

// 批量删除
export const deleteAPI = (ids) => {
    return request.delete("api/user/deletes", {
        params: {
            ids: ids
        }
    })
}

